<template>
	<view class="my-case" :style="myStyle">
		<view class="main">
			<image :src="img" style="width: 220rpx; height: 210rpx;border-radius: 8rpx;" mode="aspectFill"></image>
			<view class="right">
				<view class="title u-line-2">{{title}}</view>
				<view class="my-order-sub u-line-2">{{subTitle}}</view>

				<view class="tags u-line-1" v-if="tags.length">
					<u-tag class="tag" v-for="j in tags" :text="j" :key="j" type="warning" size="mini" mode="plain"></u-tag>
				</view>

				<view class="my-order-sub u-line-1">{{company}}</view>
			</view>
		</view>

		<view class="mid">
			<slot name="mid"></slot>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			bgColor: {
				type: String,
				default: '#fff'
			},
			img: {
				type: String,
				default: ''
			},
			title: {
				type: String,
				default: ''
			},
			subTitle: {
				type: String,
				default: ''
			},
			company: {
				type: String,
				default: ''
			},
			tags: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {
				myStyle: {
					background: this.bgColor
				}
			};
		}
	}
</script>

<style lang="scss">
	.my-case {
		width: 670rpx;
		background: rgba(255, 255, 255, 1);
		border-radius: 8rpx;
		margin: 32rpx auto;
		padding: 16rpx;

		.main {
			display: flex;
			justify-content: space-between;

			.right {
				width: 400rpx;
				display: flex;
				flex-direction: column;
				font-size: 24rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				line-height: 40rpx;

				.title {
					font-weight: bold;
					font-size: 28rpx;
					color: rgba(51, 51, 51, 1);
				}

				.tags {
					height: 50rpx;
					display: flex;
					align-items: center;

					.tag {
						margin-right: 12rpx;
					}
				}
			}
		}
	}
</style>
